class ProductsController < ApplicationController
  def index
    @title = t("h2.articles")
    @search = Product.new_search(params[:search])
    @search.conditions.productcategory_id_is = params[:category_id] unless params[:category_id].blank?
    unless params[:keyword].blank?
      keyword = split_keyword(params[:keyword])
      @search.conditions.or_introduction_like = keyword
    end
    @products = @search.all.paginate(:page => params[:page] || 1, :per_page=> params[:per_page] || 50)
  end
  
  def show
    @product = Product.find(params[:id])
  end

end
